package lx;
/**
 * 费布拉奇数列
 */
public class ShuLie {

	public static void main(String[] args) {
		int a=1,b=1,c;
        do
        {
        	c=a+b;
        	a=b;
        	b=c;
        }while(c<10);
          System.out.println("c="+ c);
      

        //求前20项    输出每五个一行
          int a1=1,b1=1,c1 ;
          System.out.print(a1+"\t"+b1+"\t");
          for(int t=3;t<=20;t++){
        	  c1=a1+b1;
        	  System.out.print(c1+"\t");
        	  a1=b1;
        	  b1=c1;
        	  if(t%5==0)
        		  System.out.println();
  
        	 
        	  
          }
          
          
          

	}

}
